﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkStation.UI.Controls
{
    public class Rectangle2Motion : MotionShape
    {
        public PointF CenterPoint;
        public float Width;
        public float Height;
        public float RotateAngle;
        public Rectangle2Motion()
        {

        }
        public Rectangle2Motion(string description)
            : base(description)
        {

        }
        public override void Draw(Graphics g)
        {
            Pen p = new Pen(PaintColor, LineWidth);
            g.TranslateTransform(CenterPoint.X, CenterPoint.Y);
            g.RotateTransform((float)RotateAngle);
            g.DrawRectangle(p, -Width / 2, -Height / 2, Width, Height);
            if (IsFill)
            {
                g.FillRectangle(new SolidBrush(Color.FromArgb(Alpha, FillColor)), -Width / 2, -Height / 2, Width, Height);
            }
            g.RotateTransform(-(float)RotateAngle);
            g.TranslateTransform(-CenterPoint.X, -CenterPoint.Y);
        }
    }
}
